'use strict';function _wu(d){function b(c,f){if(c){var e=c.commonOptions||{};e=null!=e.withPreviews?e.withPreviews&&_Dk:e.thumbSize;e=(null==e?f:e)|0;if(c.type.in("TSE","closedTabs"))a.tabIcons=!0,e&&(a.tabThumbs=Math.max(a.tabThumbs|0,e),"closedTabs"==c.type&&(a.closedTabThumbs=!0));else if(_Mg(c.content))for(let g of c.content)if(b(g,e),a.closedTabThumbs)break}}let a={};for(let [,c]of d){if(!c){15>d.length&&_6p("undefTrigActData",{trigActList:d});break}if(!c.disabled)for(let [f,e,g]of _Rs(c.actions))if("params"==
f&&"openMenu"==g.action&&e.menuId&&(b(_er(e.menuId,"menuSpec").value),a.closedTabThumbs))return a}return a}function _sy(d,b){_Uw({trigActList:null,previewMakerParams:{},customEntities:{}},d,a=>{_Ot=a.customEntities;const c=_wu(a.trigActList);_Oi=c.tabIcons;_Lj=c.closedTabThumbs;let f=(_gw=!!c.tabThumbs)?a.previewMakerParams.sc().add({thumbSize:c.tabThumbs}):{interval:0};_So(_kj,f,e=>{e||_So(_kj,f,g=>{})});b&&b(a)})}function _Td(d={}){let b={};for(let [a,{value:c}]of d)b[a]=c;_So(_Ey,b)}
function _bh(d){_tl({mouseGest:{},joysticksOrder:[],advOpts:{}},b=>{_So(_2k,b.joysticksOrder);_8w(b.mouseGest.params);_3k(b.mouseGest.display);"function"==typeof _ca&&_ca();_Hi(b.advOpts);d&&d(b)})}function _Hi(d){return _So(_lp,d)}function _re(d={},b){_Uw({trigActList:null,customEntities:{}},d,a=>{_Ot.tse=a.customEntities.tse;_Sg={};for(let [c,f]of a.trigActList)f.disabled||(_Sg[c]=f.actions||[]);_oo(_Sg);b&&b(a)})}
function _0s(d={},b){_Uw({trigActList:null,mouseGest:{},advOpts:{}},d,a=>{let c=_dh(a.trigActList,_np(a.mouseGest),a.advOpts);_So(_Po,c);let f=_aw;_aw=!_Pt(c.urlTests);f||_Lh(_7j(_os[_Ca]));b&&b(a)})}function _mg(d={},b){_sy(d,a=>_re(a,c=>_0s(c,b)))}function _dp(){_qf("toolbarBtns")(d=>{for(let [b,a]of d||[]){if(!Number.isInteger(+b)){_6p("invalidTBBtnIndex",{btnIdx:String(b),tbBtnCount:d.length});break}_ya(b,a)}})}function _4h(d){_bh(b=>_mg(b,a=>{_dp();_Oe();d&&d()}))}
{let d=0;const b=_Et(function*(a){if(!(3E3>Date.now()-d)){var c=yield e=>_Ky.storage.managed.get(null,e),f=(c.when_to_load||"").trim().split(/\s+/);if(a.in(f)){d=Date.now();a=c.administrator_settings;if(_0j(a)||_0j("file:///"+a))c=yield _i(a),c.error||(a=c.content);try{a=JSON.parse(a),a.constructor==Object&&(yield _qj(a))}catch(e){}}}});_Ky.runtime.onInstalled.addListener(a=>{"install"==a.reason&&_2u.wait()(()=>b("install"))});_Ky.runtime.onStartup.addListener(()=>{_2u.wait()(()=>b("startup"))});
_Ky.storage.onChanged.addListener((a,c)=>{"managed"==c&&_Kg(a,"administrator_settings","newValue")&&_2u.wait()(()=>b("policyChange"))})}
function _Oe(){_Ky.contextMenus.removeAll();let d=[..._Ws("binSwtch",!0)],b=["browser_action"];if(d.length){_Ky.contextMenus.create({id:"swtchList",title:"SWITCHES",contexts:b});_Ky.contextMenus.create({id:"sep1",type:"separator",contexts:b});for(let a of d)_Ky.contextMenus.create({id:a,title:_er(a).name,type:"checkbox",checked:_gy[_Uk(a)[1]],parentId:"swtchList",contexts:b})}_Ky.contextMenus.create({id:"reloadExtn",title:"Emergency repair",contexts:b})};
